package com.zkingsoft.generator.impl;

import java.util.HashMap;

import com.zkingsoft.codeApi.DataBaseType;
import com.zkingsoft.generator.TypeHandle;
/**
 * 默认的类型处理器
 * @author Matrix-J
 *
 */
public class DefaultTypeHandle implements TypeHandle {
	
	
	public static HashMap<DataBaseType, HashMap<String, String>> TypeMapping;
	
	
	static {
		
		TypeMapping = new HashMap<DataBaseType, HashMap<String, String>>();
		/**
		 * mysql映射设置
		 */
		HashMap<String, String> mysqlMap = new HashMap<String, String>();
		mysqlMap.put("double", "Double");
		mysqlMap.put("int", "Integer");
		mysqlMap.put("bigint", "Long");
		mysqlMap.put("float", "Float");
		mysqlMap.put("varchar", "String");
		mysqlMap.put("tinyint", "Boolean");
		mysqlMap.put("datetime", "Date");
		mysqlMap.put("date", "Date");
		mysqlMap.put("text", "String");
		mysqlMap.put("char", "String");
		mysqlMap.put("enum", "String");
		mysqlMap.put("smallint", "Integer");
		mysqlMap.put("mediumtext", "String");
		mysqlMap.put("tinyint", "Integer");
		mysqlMap.put("tinyint", "Integer");
		mysqlMap.put("bit", "Integer");
		mysqlMap.put("real", "Double");
		mysqlMap.put("decimal", "BigDecimal");
		mysqlMap.put("numeric", "BigDecimal");
		mysqlMap.put("time", "Date");
		mysqlMap.put("year", "Date");
		mysqlMap.put("timestamp", "Date");
		mysqlMap.put("tinyblob", "byte[]");
		mysqlMap.put("blob", "byte[]");
		mysqlMap.put("mediumblob", "byte[]");
		mysqlMap.put("longblob", "byte[]");
		mysqlMap.put("longtext", "String");
		mysqlMap.put("tinytext", "String");
		mysqlMap.put("mediumtext", "String");
		mysqlMap.put("set", "String");
		mysqlMap.put("binary", "byte[]");
		mysqlMap.put("varbinary", "byte[]");
		mysqlMap.put("point", "String");
		mysqlMap.put("linestring", "String");
		mysqlMap.put("polygon", "String");
		mysqlMap.put("geometry", "String");
		mysqlMap.put("multipoint", "String");
		mysqlMap.put("multilinestring", "String");
		mysqlMap.put("multipolygon", "String");
		mysqlMap.put("geometrycollection", "String");
		TypeMapping.put(DataBaseType.MYSQL, mysqlMap);
		
		
		
		
		
		
	}
	
	
	
	
}
